{smcl}
{com}{sf}{ul off}{txt}{.-}
      name:  {res}<unnamed>
       {txt}log:  {res}/Users/Home/Dropbox/Research/Under Review/Local Suffrage/JOP/Replication/ESSlog.smcl
  {txt}log type:  {res}smcl
 {txt}opened on:  {res}15 Mar 2024, 19:18:25

{com}. do "/var/folders/ng/tnp3fn_94p36fd9ld0hpy1940000gp/T//SD25247.000000"
{txt}
{com}. ********************************************************************************
. *Replication File: Individual (ESS) Analysis
. ********************************************************************************
. 
. ********************************************************************************
. *For use with ESS.dta file
. *Data source - ESS Cummulative file Pulled 18 May 2023
. 
. 
. *******************************************************************************
. *Data Analysis for Figure 5 and Appendix Table B.3.1.
. *******************************************************************************
. 
. 
. *Models used regarding the DV: Feel emotionally close to country*
. *Baseline for Immigrants
. eststo A1: qui mixed attachc municipal i.year i.rcode ///
>         if (noncit == 1 | immigrant == 1) & SEU28_nat!=1  ///
>         [weight=pspwght] || rcode:, robust cluster(rcode)
{txt}
{com}. *Covariate Model for Immigrants
. eststo A: qui mixed attachc municipal i.rcode ///
>         yearslived imm_par cntrylang noncit ///
>         female employed  married agea rural religious  i.year ///
>         if (noncit == 1 | immigrant == 1) & SEU28_nat!=1 ///
>         [weight=pspwght] || rcode:, robust cluster(rcode)
{txt}
{com}. *Covariate Model for Non-Citizens
. eststo ImmO: qui mixed attachc municipal i.rcode ///
>         yearslived imm_par cntrylang  ///
>         female employed  married agea rural religious  i.year ///
>         if (noncit == 1) & SEU28_nat!=1 ///
>         [weight=pspwght] || rcode:, robust cluster(rcode)
{txt}
{com}. *Covariate Model for Eligible, Non-Citizens
. eststo Imm: qui mixed attachc eligible i.rcode ///
>         yearslived imm_par cntrylang ///
>         female employed  married agea rural religious  i.year ///
>         if (noncit == 1) & SEU28_nat!=1 ///
>         [weight=pspwght] || rcode:, robust cluster(rcode)
{txt}
{com}. *Covariate Model for Non-Immigrant Citizens
. eststo AR: qui mixed attachc municipalC i.rcode ///
>         imm_par female employed  married agea rural religious i.year ///
>         if noncit == 0 & immigrant == 0 ///
>         [weight=pspwght] || rcode:, robust cluster(rcode)
{txt}
{com}.         
. *Models used regarding the DV: Feel emotionally close to Europe*
. *Baseline for Immigrants
. eststo C1: qui mixed attache municipal i.year i.rcode ///
>         if (noncit == 1 | immigrant == 1) & SEU28_nat!=1 ///
>         [weight=pspwght] || rcode:, robust cluster(rcode)
{txt}
{com}. *Covariate Model for Immigrants
. eststo C: qui mixed attache municipal i.rcode ///
>         yearslived imm_par cntrylang noncit ///
>         female employed  married agea rural religious  i.year ///
>         if (noncit == 1 | immigrant == 1) & SEU28_nat!=1  ///
>         [weight=pspwght] || rcode:, robust cluster(rcode)
{txt}
{com}. *Covariate Model for Non-Citizens
. eststo ImmOE: qui mixed attache municipal i.rcode ///
>         yearslived imm_par cntrylang  ///
>         female employed  married agea rural religious  i.year ///
>         if (noncit == 1) & SEU28_nat!=1  ///
>         [weight=pspwght] || rcode:, robust cluster(rcode)
{txt}
{com}. *Covariate Model for Eligible, Non-Citizens
. eststo ImmE: qui mixed attache eligible i.rcode ///
>         yearslived imm_par cntrylang ///
>         female employed  married agea rural religious  i.year ///
>         if (noncit == 1) & SEU28_nat!=1 ///
>         [weight=pspwght] || rcode:, robust cluster(rcode)
{txt}
{com}. *Covariate Model for Non-Immigrant Citizens
. eststo CR: qui mixed attache municipalC i.rcode ///
>         imm_par female employed  married agea rural religious i.year ///
>         if noncit == 0 & immigrant == 0  ///
>         [weight=pspwght] || rcode:, robust cluster(rcode)
{txt}
{com}.         
. *Models used regarding the DV: Feel close to local people*
. *Baseline for Immigrants        
. eststo local1: qui mixed peopleclose municipal i.year i.rcode ///
>         if (noncit == 1 | immigrant == 1) & SEU28_nat!=1 ///
>         [weight=pspwght] || rcode:, robust cluster(rcode)
{txt}
{com}. *Covariate Model for Immigrants
. eststo local2: qui mixed peopleclose municipal i.rcode ///
>         yearslived imm_par cntrylang noncit ///
>         female employed  married agea rural religious  i.year  ///
>         if (noncit == 1 | immigrant == 1) & SEU28_nat!=1 ///
>         [weight=pspwght] || rcode:, robust cluster(rcode)
{txt}
{com}. *Covariate Model for Non-Citizens
. eststo ImmOlocal: qui mixed peopleclose municipal i.rcode ///
>         yearslived imm_par cntrylang  ///
>         female employed  married agea rural religious  i.year  ///
>         if (noncit == 1) & SEU28_nat!=1  ///
>         [weight=pspwght] || rcode:, robust cluster(rcode)
{txt}
{com}. *Covariate Model for Eligible, Non-Citizens
. eststo Immlocal: qui mixed peopleclose eligible i.rcode ///
>         yearslived imm_par cntrylang ///
>         female employed  married agea rural religious  i.year  ///
>         if (noncit == 1) & SEU28_nat!=1 ///
>         [weight=pspwght] || rcode:, robust cluster(rcode)
{txt}
{com}. *Covariate Model for Non-Immigrant Citizens
. eststo localR: qui mixed peopleclose municipalC i.rcode ///
>         imm_par female employed  married agea rural religious i.year ///
>         if noncit == 0 & immigrant == 0  ///
>         [weight=pspwght] || rcode:, robust cluster(rcode)
{txt}
{com}. 
. *******************************************************************************
. *Figure Replication
. *******************************************************************************
.         
. *Figure 5
. graph set window fontfacemono "Helvetica" 
{txt}
{com}.         
. coefplot (A1, label(Non-EU Immigrants, w/o covariates) msize(small) mcolor("165 15 21") ///
>         ciopts(lcolor("165 15 21" "165 15 21") lwidth(.3 .7)) keep(municipal)) ///
>         (A, label(Non-EU Immigrants, w/covariates) msize(small) mcolor("222 45 38") ///
>                 msymbol(o) ciopts(lcolor("222 45 38" "222 45 38") lwidth(.2 .4)) keep(municipal)) ///
>         (ImmO, label(Non-EU Immigrants, w/covariates) msize(small) mcolor("251 106 74") ///
>                 msymbol(O) ciopts(lcolor("251 106 74" "251 106 74") lwidth(.2 .4)) keep(municipal)) ///
>         ///(Imm, label(Non-EU Immigrants, w/covariates) msize(small) mcolor("252 174 145") ///
>         ///     msymbol(O) ciopts(lcolor("252 174 145" "252 174 145") lwidth(.2 .4)) keep(eligible)) /// 
>         (AR, label(Non-Immigrant Citizens, w/covariates) msize(small) mcolor("97 156 255") ///
>                 msymbol(d) ciopts(lcolor("97 156 255" "97 156 255") lwidth(.2 .4)) keep(municipalC)), ///
>                 bylabel(Country Attachment) plotregion(lcolor(gs5)) || ///
>         (C1, label(Non-EU Immigrants, w/o covariates) msize(small) mcolor("165 15 21") ///
>                 msymbol(O)  ciopts(lcolor("165 15 21" "165 15 21") lwidth(.2 .4)) keep(municipal)) ///
>         (C, label(Non-EU Immigrants, w/covariates) msize(small) mcolor("222 45 38") ///
>                 ciopts(lcolor("222 45 38" "222 45 38") lwidth(.3 .7)) keep(municipal)) ///
>         (ImmOE, label(Non-EU Immigrants, w/covariates) msize(small) mcolor("251 106 74") ///
>                 msymbol(O) ciopts(lcolor("251 106 74" "251 106 74") lwidth(.2 .4)) keep(municipal)) ///
>         ///(ImmE1, label(Non-EU Immigrants, w/covariates) msize(small) mcolor("252 174 145") ///
>                 ///msymbol(O) ciopts(lcolor("252 174 145" "252 174 145") lwidth(.2 .4)) keep(eligible)) /// 
>         (CR, label(Non-Immigrant Citizens, w/covariates) msize(small) mcolor("97 156 255") ///
>                 msymbol(d) ciopts(lcolor("97 156 255" "97 156 255") lwidth(.2 .4)) keep(municipalC)), ///
>                 bylabel(Europe Attachment) plotregion(lcolor(gs5)) || ///
>         (local1, label(Non-EU Immigrants, w/o covariates) msize(small) mcolor("165 15 21") ///
>                 ciopts(lcolor("165 15 21" "165 15 21") lwidth(.2 .4)) keep(municipal)) ///
>         (local2, label(Non-EU Immigrants, w/covariates) msize(small) mcolor("222 45 38") ///
>                 msymbol(O) ciopts(lcolor("222 45 38" "222 45 38") lwidth(.2 .4)) keep(municipal)) ///
>         (ImmOlocal, label(Non-EU Immigrants, w/covariates) msize(small) mcolor("251 106 74") ///
>                 msymbol(O) ciopts(lcolor("251 106 74" "251 106 74") lwidth(.2 .4)) keep(municipal)) ///
>         ///(Immlocal, label(Non-EU Immigrants, w/covariates) msize(small) mcolor("252 174 145") ///
>                 ///msymbol(O) ciopts(lcolor("252 174 145" "252 174 145") lwidth(.2 .4)) keep(eligible)) /// 
>         (localR, label(Non-Immigrant Citizens, w/covariates) msize(small) mcolor("8 81 156") ///
>                 msymbol(d) ciopts(lcolor("8 81 156" "8 81 156") lwidth(.2 .4)) keep(municipalC)), ///
>                         bylabel(Close to Locality) ||, ///
>         bycoefs byopts(yrescale) vertical rename(municipalC = municipal eligible = municipal) ///
>         legend(order(3 "Non-EU Immigrants," "w/o covariates" ///
>                         6 "Non-EU Immigrants," "w/covariates" ///
>                         9 "Non-EU Citizens," "w/covariates" ///
>                         12 "Non-Immigrant Citizens," "w/covariates") ///
>                         title({c -(}bf:Model{c )-}, size(small) pos(12) color(gs5)) ///
>                         region(lcolor(gs5)) size(vsmall) color(gs5) col(1) pos(3)) ///
>                 levels(95 90) ///
>                 yline(0, lcolor(gs5) lpattern(dash)) ///
>                 xlabel(, labsize(small) labcolor(gs5)) ///
>                 ylabel(, glcolor(gs15) ang(0) labsize(small) labcolor(gs5)) ///
>                 xline(1.5 2.5 3.5, lcolor(gs9)) ///
>         graphregion(color(white) lcolor(gs5)) ///
>                 plotregion(lcolor(gs5)) yline(0, lcolor(gs5) lpattern(dash)) ///
>                 title("Predicting Attachment by Non-EU Suffrage" " ", ///
>                         bexpand color(gs5) bcolor(white) pos(11) size(medsmall)) ///
>                 grid(lcolor(gs5)) ///
>                 yscale(lcolor(gs5) noex) ///
>                 xscale(lcolor(gs5) noex) bgcol(white)
{res}{txt}
{com}.         
. graph export Figure5.png, replace
{txt}(file Figure5.png written in PNG format)

{com}. 
. *******************************************************************************
. *Table Replication
. *******************************************************************************
. 
. *Appendix Table B.3.1 (p.24)
. esttab A1 A ImmO using AppendixB31.tex, se(3) b(3) aic ///
>         nogaps star(+ 0.1 * 0.05 ** 0.01) ///
>         drop(*rcode) ///
>         indicate(Fixed Effects = *year, labels("Country \& Year" "--")) ///
>         label nonumbers ///
>         addnotes("Unstandardized beta coefficients with robust clustered standard errors in parentheses." ///
>         "Country random intercept. Weighted by PSPWeight. +\textit{c -(}p{c )-} $<$ 0.10 * \textit{c -(}p{c )-} $<$ 0.05, ** \textit{c -(}p{c )-} $<$ 0.01.") nonotes replace
{res}{txt}(output written to {browse  `"AppendixB31.tex"'})

{com}. 
. *Appendix Table B.3.1 (p.25)
. esttab C1 C ImmOE local1 local2 ImmOlocal using AppendixB312.tex, se(3) b(3) aic ///
>         nogaps star(+ 0.1 * 0.05 ** 0.01) ///
>         drop(*rcode) ///
>         indicate(Fixed Effects = *year, labels("Country \& Year" "--")) ///
>         label nonumbers ///
>         addnotes("Unstandardized beta coefficients with robust clustered standard errors in parentheses." ///
>         "Country random intercept. Weighted by PSPWeight. +\textit{c -(}p{c )-} $<$ 0.10 * \textit{c -(}p{c )-} $<$ 0.05, ** \textit{c -(}p{c )-} $<$ 0.01.") nonotes replace
{res}{txt}(output written to {browse  `"AppendixB312.tex"'})

{com}. 
. *Appendix Table C.3.1
. esttab Imm AR ImmE CR Immlocal localR using AppendixC31.tex, se(3) b(3) aic ///
>         nogaps star(+ 0.1 * 0.05 ** 0.01) ///
>         order(eligible municipal yearslived) ///
>         drop(*rcode) ///
>         indicate(Fixed Effects = *year, labels("Country \& Year" "--")) ///
>         label nonumbers ///
>         addnotes("Unstandardized beta coefficients with robust clustered standard errors in parentheses." ///
>         "Country random intercept. Weighted by PSPWeight. +\textit{c -(}p{c )-} $<$ 0.10 * \textit{c -(}p{c )-} $<$ 0.05, ** \textit{c -(}p{c )-} $<$ 0.01.") nonotes replace
{res}{txt}(output written to {browse  `"AppendixC31.tex"'})

{com}. 
. ********************************************************************************
. *Descriptive Table 
. ********************************************************************************
. *Data for Appendix A.3.2
. //Immigrants
. sum municipal female employed married agea religious ///
>         imm_par cntrylang noncit rural yearslived if ///
>         (noncit == 1 | immigrant == 1) & SEU28_nat!=1 & ///
>         (attachc!=. | attache!=. | peopleclose!=.) & ///
>         (municipal!=. & female!=. & employed!=. & married!=. & agea!=. & religious!=. & ///
>         imm_par!=. & cntrylang!=. & noncit!=. & rural!=. & yearslived!=.) [weight=pspwght]
{txt}(analytic weights assumed)

    Variable {c |}     Obs      Weight        Mean   Std. Dev.       Min        Max
{hline 13}{c +}{hline 65}
{space 3}municipal {c |}{res}   8,621  9225.75104    .5364308      .4987          0          1
{txt}{space 6}female {c |}{res}   8,621  9225.75104    .5227021   .4995133          0          1
{txt}{space 4}employed {c |}{res}   8,621  9225.75104    .5398136   .4984413          0          1
{txt}{space 5}married {c |}{res}   8,621  9225.75104    .5568153   .4967903          0          1
{txt}{space 8}agea {c |}{res}   8,595    9194.747    45.95947   17.00206         15         96
{txt}{hline 13}{c +}{hline 65}
{space 3}religious {c |}{res}   8,621  9225.75104    .6685254   .4707706          0          1
{txt}{space 5}imm_par {c |}{res}   8,621  9225.75104    .9009874   .2986963          0          1
{txt}{space 3}cntrylang {c |}{res}   8,621  9225.75104    .8012316   .3990965          0          1
{txt}{space 6}noncit {c |}{res}   8,621  9225.75104    .3844939   .4865036          0          1
{txt}{space 7}rural {c |}{res}   8,621  9225.75104     .204697   .4035034          0          1
{txt}{hline 13}{c +}{hline 65}
{space 2}yearslived {c |}{res}   8,621  9225.75104    26.08783   18.41883          0         90
{txt}
{com}. //Citizens
. sum municipalC female employed married agea religious ///
>         imm_par cntrylang noncit rural if ///
>         noncit == 0 & immigrant == 0 &  ///
>         (attachc!=. | attache!=. | peopleclose!=.) & ///
>         (municipalC!=. & female!=. & employed!=. & married!=. & agea!=. & religious!=. & ///
>         imm_par!=. & rural!=.) [weight=pspwght]
{txt}(analytic weights assumed)

    Variable {c |}     Obs      Weight        Mean   Std. Dev.       Min        Max
{hline 13}{c +}{hline 65}
{space 2}municipalC {c |}{res} 137,871  137665.046    .5789903   .4937229          0          1
{txt}{space 6}female {c |}{res} 137,871  137665.046    .5175011   .4996954          0          1
{txt}{space 4}employed {c |}{res} 137,871  137665.046    .5287529   .4991744          0          1
{txt}{space 5}married {c |}{res} 137,871  137665.046    .5156637   .4997564          0          1
{txt}{space 8}agea {c |}{res} 137,395  137232.645     47.4029   18.88853         14        103
{txt}{hline 13}{c +}{hline 65}
{space 3}religious {c |}{res} 137,871  137665.046    .5836454   .4929556          0          1
{txt}{space 5}imm_par {c |}{res} 137,871  137665.046    .0738528   .2615322          0          1
{txt}{space 3}cntrylang {c |}{res} 137,871  137665.046    .9692614   .1726092          0          1
{txt}{space 6}noncit {c |}{res} 137,871  137665.046           0          0          0          0
{txt}{space 7}rural {c |}{res} 137,871  137665.046    .3871387   .4870976          0          1
{txt}
{com}. 
{txt}end of do-file

{com}. log close
      {txt}name:  {res}<unnamed>
       {txt}log:  {res}/Users/Home/Dropbox/Research/Under Review/Local Suffrage/JOP/Replication/ESSlog.smcl
  {txt}log type:  {res}smcl
 {txt}closed on:  {res}15 Mar 2024, 19:47:13
{txt}{.-}
{smcl}
{txt}{sf}{ul off}